import request from '@/utils/request'

// 查询实验预约列表
export function listReservation(query) {
    return request({
        url: '/biz/reservation/list',
        method: 'get',
        params: query
    })
}

// 查询本人实验预约列表
export function listReservationMe(query) {
    return request({
        url: '/biz/reservation/list/me',
        method: 'get',
        params: query
    })
}

// 查询当前登陆用户的预约记录
export function listReservationByCurrentUser(query) {
    return request({
        url: '/biz/reservation/listByCurrentUser',
        method: 'get',
        params: query
    })
}

// 查询实验预约详细
export function getReservation(id) {
    return request({
        url: '/biz/reservation/' + id,
        method: 'get'
    })
}

// 新增实验预约
export function addReservation(data) {
    return request({
        url: '/biz/reservation',
        method: 'post',
        data: data
    })
}

// 修改实验预约
export function updateReservation(data) {
    return request({
        url: '/biz/reservation',
        method: 'put',
        data: data
    })
}

// 取消实验课程
export function cancelReservation(id) {
  return request({
    url: '/biz/reservation/cancel/' + id,
    method: 'put',
  })
}

// 删除实验预约
export function delReservation(id) {
    return request({
        url: '/biz/reservation/' + id,
        method: 'delete'
    })
}

// 审批实验预约
export function auditReservation(data) {
    return request({
        url: '/biz/reservation/audit',
        method: 'put',
        params: data
    })
}
